
import axios from "../request";
// (1)游客机正常
// 游客机正常状态列表
export const tourList = (current, size, num) => {
    return axios({
        method: "get",
        url: `/test/VisitorMachineCommon/${current}/${size}/${num}`,
    })
}
// 新增personName
export const addDevice = (visitorNumber, visitorPerson) => {
    return axios({
        method: "post",
        url: `/test/VisitorMachineCommon?visitorNumber=${visitorNumber}&visitorPerson=${visitorPerson}`,
    })
}

// 修改
export const toAbnormal = (currentPage, pageSize, form) => {
    return axios({
        method: 'put',
        url: '/test/VisitorMachineCommon',
        data: {
            currentPage,
            pageSize,
            visitorId: form.id,
            visitorNumber: form.num,
            visitorPerson: form.name,
            visitorStatus: form.states
        }
    })
}
// 查询四大状态总数
export const getAllStatus = () => {
    return axios({
        method: 'get',
        url: '/test/VisitorMachineCommon/queryAllStatus'
    })
}

//(2)游客机异常
// 查询游客机总数
export const getAbnormalTotal = () => {
    return axios({
        method: 'get',
        url: '/test/VisitorMachineAbnormal/abnormalCount'
    })
}
// 列表信息
export const getAbnormalList = (current, size, num, name) => {
    return axios({
        method: 'get',
        url: `/test/VisitorMachineAbnormal`,
        params: {
            currentPage: current,
            pageSize: size,
            num: num,
            exceptionPerson: name
        }
    })
}

// 修改游客机异常状态
export const editAbnormal = (id, states) => {
    return axios({
        method: 'put',
        url: `/test/VisitorMachineAbnormal/${id}/${states}`,
    })
}
// (3)导游机管理
export const registerStatistic = () => {
    return axios({
        method: "get",
        url: '/test/TourGuideMachine'
    })
}
// 根据导游工号获取导游信息
export const getInfoById = (id) => {
    return axios({
        method: 'get',
        url: `/test/TourGuideMachine/selectTourBaseInFo/${id}`
    })
}

// 保持绑定
export const keepBinding = (explainId, tourId) => {
    return axios({
        method: 'put',
        url: '/test/TourGuideMachine/keepBind',
        data: {
            tourNumber: tourId, //sn码 1001
            userMessageJobNumber: explainId, //讲解员工号 123
            userMessageName: "",
            userMessagePwd: ""
        }
    })
}
//解绑
export const unBinding = (form) => {
    return axios({
        method: 'put',
        url: '/test/TourGuideMachine/unBind',
        data: {
            tourNumber: "",
            userMessageJobNumber: form.id,
            userMessageName: form.name,
            userMessagePwd: form.pwd
        }
    })
}

// 新增导游机
export const AddGuide = (num) => {
    return axios({
        method: "post",
        url: `/test/TourGuideMachine/${num}`
    })
}
// 导游机列表
export const guideList = (current, size) => {
    return axios({
        method: 'post',
        url: `/test/TourGuideMachine/${current}/${size}`
    })
}





